using System.Runtime.InteropServices;
using System;

namespace Recast
{
	public unsafe partial class RecastGlobal
	{
		[StructLayout(LayoutKind.Sequential)]
		public unsafe partial struct rcCompactHeightfield : IDisposable
		{
			public int width;
			public int height;
			public int spanCount;
			public int walkableHeight;
			public int walkableClimb;
			public int borderSize;
			public ushort maxDistance;
			public ushort maxRegions;
			public fixed float bmin[3];
			public fixed float bmax[3];
			public float cs;
			public float ch;
			public rcCompactCell* cells;
			public rcCompactSpan* spans;
			public ushort* dist;
			public byte* areas;

			public void Dispose()
			{
				rcFree(cells);
				rcFree(spans);
				rcFree(dist);
				rcFree(areas);
			}
		}
	}
}
